<template>
    <div class="table">
        <div class="container">
            <el-table :data="tableData" border class="table" ref="multipleTable">
                <el-table-column prop="user_name" label="踩的人">
                </el-table-column>
                <el-table-column prop="create_time" sortable label="踩的时间">
                </el-table-column>
            </el-table>
            <div class="block">
                <span class="demonstration"></span>
                <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page.sync="currentPage1"
                    :page-size="pageSize"
                    layout="total, prev, pager, next"
                    :total="totalRow">
                </el-pagination>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        components:{
        },
        name: 'basetable',
        data() {
            return {
                select_word: '',
                tableData: [],
                cur_page: 1,
                multipleSelection: [],
                editVisible: false,

                privilegeId: '',

                img: '',
                pageSize: 0,
                totalRow: 0,
                currentPage1: 0,
                pageNumber: '',
            }
        },
        created() {
        },
        computed: {
            data() {
            }
        },
        props: ['uid'],
        methods: {
            loadopen() {
                this.loading = this.$loading({
                    lock: true,
                    text: 'Loading',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.2)'
                });
                setTimeout(() => {this.loading.close();}, 5000);
            },
            loadclose() {
                this.loading.close();
            },
            // 获取列表数据
            getInfo() {
                this.loadopen();
                // console.log(this.uid);
                this.config.post('/housinggestate/housinggestate/dynamictread/findPage', {
                    dynamicId: this.uid,
                    pageNum: this.pageNumber?this.pageNumber:1,
                }).then(res=>{
                    this.loadclose();
                    if(res.data.code==='0'){
                        this.tableData = res.data.page.list;
                        this.pageSize = res.data.page.pageSize;
                        this.totalRow = res.data.page.totalRow;
                        this.currentPage1 = res.data.page.pageNumber;
                    }else {
                        this.$message.error(this.config.handleError(res.data));
                    }
                })
            },
            // 分页导航
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
                this.getData(val);
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
        }
    }

</script>

<style scoped>
    .handle-box {
        margin-bottom: 20px;
    }

    .handle-select {
        width: 120px;
    }

    .handle-input {
        width: 300px;
        display: inline-block;
    }
    .del-dialog-cnt{
        font-size: 16px;
        text-align: center
    }
    .table{
        width: 100%;
        font-size: 14px;
    }
    .red{
        color: #ff0000;
    }
</style>
